﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Configuration;
using System.Windows;

namespace Project_CFT2
{
  public class myDataItem : DependencyObject
  {
    // Note how the TitleProperty is a DependencyProperty, and the Title CLR property is
    // here just for convenience. The string itself is not stored in the object, it's
    // stored in the WPF framework.

    public string Title
    {
      get
      {
        return (string) GetValue( TitleProperty );
      }
      set
      {
        SetValue( TitleProperty, value );
      }
    }
    public string ID
    {
        get
        {
            return (string) GetValue(IdProperty);
        }
        set
        {
            SetValue(IdProperty, value);
        }
    }
    public string Type
    {
        get
        {
            return (string)GetValue(TypeProperty);
        }
        set
        {
            SetValue(TypeProperty, value);
        }
    }
    public string Price
    {
        get
        {
            return (string)GetValue(PriceProperty);
        }
        set
        {
            SetValue(PriceProperty, value);
        }
    }
    public string Im
    {
        get
        {
            return (string)GetValue(ImProperty);
        }
        set
        {
            SetValue(ImProperty, value);
        }
    }

    // Using a DependencyProperty as the backing store for Title.  This enables animation, styling, binding, etc...
    public static readonly DependencyProperty TitleProperty =
        DependencyProperty.Register( "Title", typeof( string ), typeof( myDataItem ), new UIPropertyMetadata( "" ) );
    public static readonly DependencyProperty IdProperty =
      DependencyProperty.Register("ID", typeof(string), typeof(myDataItem), new UIPropertyMetadata(""));
    public static readonly DependencyProperty TypeProperty =
        DependencyProperty.Register("Type", typeof(string), typeof(myDataItem), new UIPropertyMetadata(""));
    public static readonly DependencyProperty PriceProperty =
        DependencyProperty.Register("Price", typeof(string), typeof(myDataItem), new UIPropertyMetadata(""));
    public static readonly DependencyProperty ImProperty =
          DependencyProperty.Register("Im", typeof(string), typeof(myDataItem), new UIPropertyMetadata(""));
    /*
    public myDataItem( string name, string id, string type, string price, string image)
    {
        Title = name;
        ID = id;
        Type = type;
        Price = price;
        Image = image;
      
    }
     */
    public myDataItem(Furniture1 x)
    {
        Title = x.Name.ToString();
        ID = x.ID.ToString();
        Type = x.Type.ToString();
        Price = x.Price.ToString();
        Im = x.Image.ToString();
    }
  }
}
